<template>
  <!-- 装载是内容 -->
  <div class="tabs-panel" v-show="activeName === name">
    <slot />
  </div>
</template>

<script>
import { inject } from "vue"

export default {
  name: 'TabsPanel',
  props: {
    // 标签页标题
    label: {
      type: String,
      default: ''
    },
    // 唯一标识
    name: {
      type: [String, Number],
      default: ''
    }
  },
  setup(props) {
    // 控制当前显示的Panel
    const activeName = inject('activeName')


    return {
      activeName
    }
  }
}
</script>